package com.liuning.async.controller;

import com.liuning.async.service.AsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AsyncController {

    /**
     * 异步的方法必须注入进来，不可以在同一个类中进行操作
     */
    @Autowired
    private AsyncService asyncService;

    @RequestMapping("/hello")
    public String hello() {
        asyncService.hello();
        return "执行完成";
    }
}
